//
//  CAICameraBottomPreviewPhotosView.h
//  CAIImagePickerControllerKit
//
//  Created by 海参 on 2022/8/4.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


@class CAICameraBottomPreviewPhotosView;
@class CAIUIImagePickerCameraPhotoModel;
@protocol CAICameraBottomPreviewPhotosViewDelegate <NSObject>

@optional
/// 删除事件
- (void)cameraBottomPreviewPhotosView:(CAICameraBottomPreviewPhotosView *)view commitEditingForRowAtIndexPath:(NSIndexPath *)indexPath;


/// 点击photo
/// @param view 当前对象
/// @param index 索引
/// @param photos 只能是指定模型对象；
- (void)cameraBottomPreviewPhotosView:(CAICameraBottomPreviewPhotosView *)view
              didSelectPicItemAtIndex:(NSInteger)index
                           photos:(NSArray<CAIUIImagePickerCameraPhotoModel *> *)photos;

@end



@class CAICameraPhotoInfoModel;
@interface CAICameraBottomPreviewPhotosView : UIView<UICollectionViewDelegate,
UICollectionViewDelegateFlowLayout,
UICollectionViewDataSource>

@property (nonatomic, weak) id <CAICameraBottomPreviewPhotosViewDelegate>delegate;

@property (nonatomic, assign) UIEdgeInsets sectionInset;


/// 图片之间的理论最小间距，不考虑右上角删除按钮大小的图片间距，内部会自己计算实际最小间距;
/// 默认是ZXMinimumInteritemSpacing=12
@property (nonatomic, assign) CGFloat minimumInteritemSpacing;


/// 理论行间距；内部设置实际是计算减去删除按钮的； 默认是ZXMinimumLineSpacing=12；
@property (nonatomic, assign) CGFloat minimumLineSpacing;

@property (nonatomic, assign) BOOL showItemDeleteIconButton;

@property (nonatomic, assign) CGFloat picItemWidth;
@property (nonatomic, assign) CGFloat picItemHeight;


/// 最多可显示的item数量，到达这个数，就不能再加入
@property (nonatomic, assign) NSInteger maxItemCount;

/// 默认9
@property (nonatomic, assign) CGFloat picItemLayoutTop;
/// 默认9
@property (nonatomic, assign) CGFloat picItemLayoutRight;

/// 设置小圆点颜色
@property (nonatomic, strong) UIColor *pointColor;

/// 设置数据源
/// @param data 数据源数组；
- (void)setData:(NSArray<CAIUIImagePickerCameraPhotoModel *> *)data;


/// 滚动到指定item
- (void)scrollToItemAtIndex:(NSInteger)index;

/// 选中指定item
- (void)selectItemAtIndex:(NSInteger)index;


- (CGFloat)getTotalHeightWithRows:(NSInteger)rows;

@end

NS_ASSUME_NONNULL_END
